package com.shibida.shibidaProject.userInfo.dao;

import com.shibida.shibidaProject.userInfo.domain.DishVO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Repository
    public interface DishRepository extends JpaRepository<DishVO, Integer> {
        //    通过id获取所有信息
        @Query(value = "select * from t_dish where id=:id", nativeQuery = true)
        List<DishVO> getAllById(int id);

        @Query(value = "select * from t_dish", nativeQuery = true)
        List<DishVO> getAll();

}